package com.qianyu.project.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qianyu.project.entity.DeviceRequirePlan;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qianyu.project.mapper.provider.mfy.DeviceRequirePlanProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 设备需求计划 Mapper 接口
 * </p>
 *
 * @author gs
 * @since 2021-01-30
 */
@Repository
public interface DeviceRequirePlanMapper extends BaseMapper<DeviceRequirePlan> {

    @Select("select max(id) id from device_require_plan where DATE_FORMAT(tbdate,'%Y')=#{value}")
    Map<String,Integer> getAddId(String year);

    @SelectProvider(method = "Mylist",type = DeviceRequirePlanProvider.class)
    IPage<DeviceRequirePlan> Mylist(IPage<DeviceRequirePlan> page,@Param("params") Map<String, String> params);

    @SelectProvider(method = "listNopage",type = DeviceRequirePlanProvider.class)
    List<DeviceRequirePlan> listNopage(Map<String,String> params);
}
